﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WebQQ批量挂QQ软件
{
    public partial class frmVerifycode : Form
    {
        public bool changeOne = false;//看不清，换一张
        public string verifycode = string.Empty;//输入的验证码

        public frmVerifycode(Image image, string qq)
        {
            InitializeComponent();
            picVerifycode.Image = image;
            this.Text += " QQ:" + qq;
        }

        //输入验证码
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (picVerifycode.Image != null && txtVerifyCode.Text.Trim() == "")
            {
                MessageBox.Show("请输入验证码！");
                txtVerifyCode.Focus();
                return;
            }
            verifycode = txtVerifyCode.Text.Trim();
            this.Close();
        }

        //取消输入
        private void btnCancel_Click(object sender, EventArgs e)
        {
            verifycode = null;
            this.Close();
        }

        //看不清，换一张
        private void lklblChangePic_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            changeOne = true;
            this.Close();
        }

        //回车直接输入验证码
        private void txtVerifyCode_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                e.Handled = true;
                btnOk.PerformClick(); ;
            }
        }
    }
}
